package com.poorstu.web;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.common.base.web.BaseAction;
import com.poorstu.manager.RoleManager;
import com.poorstu.model.RoleMod;

public class RoleChgedAction extends BaseAction {

	 //点击提交以后修改role
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		try {
			int roleid=Integer.parseInt(request.getParameter("id"));//获取选中角色id
			
			
			RoleManager roleMeg=(RoleManager)getBean("roleMeg");
			RoleMod role = roleMeg.getPowerByRoleId(roleid);//获得选择的角色对象
			
			//封装页面需要的数据
			request.setAttribute("role", role);
		} catch (Exception e) {
			e.printStackTrace();
			return mapping.findForward("failure");
		}
		return mapping.findForward("succc");
		
		
		
		
		
	}
	

}
